package com.xcf.center;

public class ServerMeta {

    private String ip;
    private Integer port;
    private String serverName;
    private Integer serverNo;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public Integer getServerNo() {
        return serverNo;
    }

    public void setServerNo(Integer serverNo) {
        this.serverNo = serverNo;
    }

    public String getUniqueName() {
        if (null != serverName) {
            return serverName + "_" + serverNo;
        }
        return ip + ":" + port;
    }

    @Override
    public String toString() {
        return '{' +
                "ip='" + ip + '\'' +
                ", port=" + port +
                ", serverName='" + serverName + '\'' +
                ", serverNo=" + serverNo +
                '}';
    }
}
